<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="websql.Query"%>
<%@page import="unit.EscapeUnescape"%>
<%@page import="websql.Var"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
	request.setCharacterEncoding("UTF-8");
%>
<%
	String sqid = request.getParameter("qid");
	if (!sqid.equals("")) {

		int qid = Integer.parseInt(sqid);
		String towright = " <table id =vars border =1><tr><td>查询条件</td><td>输入查询条件</td><td>举例</td>";
		String vars[] = Var.getVarNames(qid);
		for (int i = 0; i < vars.length; i++) {
			int vid = Var.getvid("vname", EscapeUnescape
					.escape(vars[i]));
			towright += "<tr><td>" + vars[i]
					+ "</td><td><input type=\"text\" name=\"vid" + vid
					+ "\"></td><td>" + Var.get("vtar", vid)
					+ "</td></tr>";
		}
		towright += "</table>";
		out.print(towright);
	}
%>
</body>
</html>